<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>大学生就业管理系统登录</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', sans-serif;
            background: linear-gradient(135deg, #1e3c72, #2a5298);
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .login-container {
            background: rgba(255, 255, 255, 0.95);
            padding: 40px;
            border-radius: 10px;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
            width: 400px;
            position: relative;
            margin: 100px auto;
        }

        .login-title {
            text-align: center;
            margin-bottom: 30px;
            color: #1e3c72;
            font-size: 24px;
            font-weight: bold;
        }

        .role-select {
            width: 100%;
            padding: 12px;
            margin-bottom: 20px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 16px;
        }

        .form-group {
            margin-bottom: 20px;
            position: relative;
        }

        .form-group input {
            width: 100%;
            padding: 12px 45px 12px 15px; /* 增加右侧内边距 */
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 18px; /* 增加字体大小 */
        }

        .form-group i {
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: #666;
            font-size: 18px; /* 增加图标大小以匹配文字 */
        }

        .login-btn {
            width: 100%;
            padding: 12px;
            background: #1e3c72;
            color: white;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .login-btn:hover {
            background: #2a5298;
        }

        .register-btn {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 8px 15px;
            background-color: #4CAF50;
            color: white;
            text-decoration: none;
            border-radius: 4px;
            font-size: 14px;
            transition: background-color 0.3s;
        }

        .register-btn:hover {
            background-color: #45a049;
        }

        .error-message {
            color: red;
            font-size: 14px;
            margin-bottom: 20px;
            text-align: center;
        }
    </style>
</head>
<body>

<div class="login-container">
    <h2 class="login-title">大学生就业管理系统</h2>
    <a href="{% url 'author:register' %}" class="register-btn">注册</a>

    {% if error %}
        <div class="error-message">
            {{ error }}
        </div>

    {% endif %}
    <form action="" method="POST">
        {% csrf_token %}
        <select name="role" class="role-select" required>
            <option value="" disabled selected>请选择角色</option>
            <option value="student">学生</option>
            <option value="company">企业</option>
            <option value="admin">管理员</option>
        </select>
        <div class="form-group">
            <input type="text" name="username" placeholder="用户名" required>
            <i class="fas fa-user"></i>
        </div>

        <div class="form-group">
            <input type="password" name="password" placeholder="密码" required>
            <i class="fas fa-lock"></i>
        </div>
        <button type="submit" class="login-btn">登录</button>
    </form>
</div>

</body>
</html>
